<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Etro Store - Premium Multipurpose HTML5/CSS3 Theme</title>
    <meta charset="utf-8"/>

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

    <!-- FAVICONS -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" th:href="@{icons/apple-touch-icon-144-precomposed.png}"/>
    <link rel="apple-touch-icon-precomposed" sizes="114x114" th:href="@{icons/apple-touch-icon-114-precomposed.png}"/>
    <link rel="apple-touch-icon-precomposed" sizes="72x72" th:href="@{icons/apple-touch-icon-72-precomposed.png}"/>
    <link rel="apple-touch-icon-precomposed" th:href="@{icons/apple-touch-icon-57-precomposed.png}"/>
    <link rel="shortcut icon" th:href="@{icons/favicon.png}"/>

    <!-- GOOGLE WEB FONTS -->
    <link rel="stylesheet" th:href="@{css/font-awesome.min.css}">

    <!-- BOOTSTRAP 3.3.7 CSS -->
    <link rel="stylesheet" th:href="@{css/bootstrap.min.css}"/>

    <!-- SLICK v1.6.0 CSS -->
    <link rel="stylesheet" th:href="@{css/slick-1.6.0/slick.css}"/>

    <link rel="stylesheet" th:href="@{css/jquery.fancybox.css}"/>
    <link rel="stylesheet" th:href="@{css/yith-woocommerce-compare/colorbox.css}"/>
    <link rel="stylesheet" th:href="@{css/owl-carousel/owl.carousel.min.css}"/>
    <link rel="stylesheet" th:href="@{css/owl-carousel/owl.theme.default.min.css}"/>
    <link rel="stylesheet" th:href="@{css/js_composer/js_composer.min.css}"/>
    <link rel="stylesheet" th:href="@{css/woocommerce/woocommerce.css}"/>
    <link rel="stylesheet" th:href="@{css/woocommerce/woocommerce-layout.css}"/>
    <link rel="stylesheet" th:href="@{css/woocommerce/woocommerce-smallscreen.css}"/>
    <link rel="stylesheet" th:href="@{css/yith-woocommerce-wishlist/style.css}"/>


    <link rel="stylesheet" th:href="@{css/custom.css}"/>
    <link rel="stylesheet" th:href="@{css/app-orange.css}" id="theme_color"/>
    <link rel="stylesheet" href="" id="rtl"/>
    <link rel="stylesheet" th:href="@{css/app-responsive.css}"/>
</head>

<body class="page woocommerce-wishlist woocommerce woocommerce-page">
<div class="body-wrapper theme-clearfix">
    <header id="header" class="header header-style1">

        <div class="widget pull-left" style="margin-left: 300px">
            <div class="widget-inner">
                <div id="lang_sel">
                    <ul class="nav">
                        <li>
                            <a class="lang_sel_sel">
                                <img class="iclflag" title="English" alt="en" th:src="@{images/icons/en.png}" width="18"
                                     height="12"/> English
                            </a>
                            <ul>
                                <li>
                                    <a th:href="@{/wishlist(l='en_US')}">
                                        <img class="iclflag" title="English" alt="en" th:src="@{images/icons/en.png}"
                                             width="18" height="12"/> English
                                    </a>
                                </li>

                                <li>
                                    <a th:href="@{/wishlist(l='zh_CN')}">
                                        <img class="iclflag" title="中文" alt="ar" th:src="@{images/icons/ar.png}"
                                             width="18" height="12"/> 中文
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <div th:replace="commons/bar::#top"></div>

        <div th:replace="commons/bar::#mid"></div>

        <div th:replace="commons/bar::#bottom"></div>
    </header>

    <div class="listings-title">
        <div class="container">
            <div class="wrap-title">
                <h1 th:text="#{wishlist}">Wishlist</h1>
                <div class="bread">
                    <div class="breadcrumbs theme-clearfix">
                        <div class="container">
                            <ul class="breadcrumb">
                                <li>
                                    <a th:href="@{/index}" th:text="#{home}">Home</a>
                                    <span class="go-page"></span>
                                </li>

                                <li class="active">
                                    <span th:text="#{wishlist}">Wishlist</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="container">
        <div class="row">
            <div id="contents" role="main" class="main-page  col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="post-6 page type-page status-publish hentry">
                    <div class="entry-content">
                        <div class="entry-summary">
                            <div id="yith-wcwl-messages"></div>
                            <form id="yith-wcwl-form" action="" method="post" class="woocommerce">

                                <!-- END TITLE -->

                                <!-- WISHLIST TABLE  愿望清单表-->
                                <!--<span th:if="${session.userInfo != null }">	Hello <strong><span th:text="${session.userInfo.username}"></span>
                                            </strong></span>

                                            <span th:if="${session.userInfo == null}">
                                                [[#{notlogin}]]
                                                <a th:href="@{/createaccount}">[[#{clickheretologin}]]</a>
                                            </span>-->
                                <div th:if="${session.userInfo != null }">
                                    <!-- TITLE -->
                                    <div class="wishlist-title ">
                                        <h2>[[#{mywishlist}]]</h2>
                                    </div>
                                    <table class="shop_table cart wishlist_table">
                                        <thead>
                                        <tr>
                                            <th class="product-remove"></th>

                                            <th class="product-name">
                                                <span class="nobr">[[#{productname}]]</span>
                                            </th>

                                            <th class="product-price">
                                                <span class="nobr">[[#{unitprice}]]</span>
                                            </th>

                                            <th class="product-stock-stauts">
                                                <span class="nobr">[[#{stockstatus}]]</span>
                                            </th>

                                            <th class="product-add-to-cart"></th>
                                        </tr>
                                        </thead>
                                        <!--商品栏-->

                                        <tbody>
                                        <tr th:each="item:${wish}">
                                            <td class="product-remove">
                                                <div>
                                                    <a data-th-attr="onclick='deleteItem(this,\''+${item.getProduct().getPid()}+'\')'"
                                                       href="" class="remove remove_from_wishlist"
                                                       title="Remove this product">&#215;</a>
                                                </div>
                                            </td>

                                            <td class="product-name">
                                                <a th:href="'/simpleproduct/'+${item.product.pid}"
                                                   th:text="${item.product.pname}">Pisan maze ikan kazen</a>
                                            </td>

                                            <td class="product-price">
                                                <del th:if="${item.product.deals!=0}"
                                                     th:text="'￥'+${item.product.marketPrice}">
                                                </del>

                                                <ins th:text="'￥'+${item.product.shopPrice}">
                                                </ins>
                                            </td>

                                            <td class="product-stock-status">
													<span class="wishlist-in-stock" th:if="${item.product.stock>0}">
														有货</span>
                                                <span class="wishlist-in-stock" th:if="${item.product.stock ==0}">
														无货</span>
                                            </td>

                                            <td class="product-add-to-cart">
                                                <a rel="nofollow"
                                                   data-th-attr="onclick='addToCart(this,\''+${item.getProduct().getPid()}+'\')'"
                                                   href=""
                                                   class="button product_type_simple add_to_cart_button ajax_add_to_cart add_to_cart button alt">[[#{addtocart}]]</a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>

                                <span th:if="${session.userInfo == null}">
													[[#{notlogin}]]
													<a th:href="@{/createaccount}">[[#{clickheretologin}]]</a>
												</span>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


</div>

<!-- DIALOGS -->

<div th:replace="commons/bar::#login_form"></div>


<a id="etrostore-totop" href="#"></a>

<script type="text/javascript" th:src="@{js/jquery/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{js/jquery/jquery-migrate.min.js}"></script>
<script type="text/javascript" th:src="@{js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{js/jquery/js.cookie.min.js}"></script>

<!-- OPEN LIBS JS -->
<script type="text/javascript" th:src="@{js/owl-carousel/owl.carousel.min.js}"></script>
<script type="text/javascript" th:src="@{js/slick-1.6.0/slick.min.js}"></script>

<script type="text/javascript" th:src="@{js/yith-woocommerce-compare/jquery.colorbox-min.js}"></script>
<script type="text/javascript" th:src="@{js/isotope/isotope.js}"></script>
<script type="text/javascript" th:src="@{js/fancybox/jquery.fancybox.pack.js}"></script>
<script type="text/javascript" th:src="@{js/sw_woocommerce/category-ajax.js}"></script>
<script type="text/javascript" th:src="@{js/sw_woocommerce/jquery.countdown.min.js}"></script>
<script type="text/javascript" th:src="@{js/js_composer/js_composer_front.min.js}"></script>

<script type="text/javascript" th:src="@{js/plugins.js}"></script>
<script type="text/javascript" th:src="@{js/megamenu.min.js}"></script>
<script type="text/javascript" th:src="@{js/main.min.js}"></script>

<script type="text/javascript">
    var sticky_navigation_offset_top = $("#header .header-bottom").offset().top;
    var sticky_navigation = function () {
        var scroll_top = $(window).scrollTop();
        if (scroll_top > sticky_navigation_offset_top) {
            $("#header .header-bottom").addClass("sticky-menu");
            $("#header .header-bottom").css({"top": 0, "left": 0, "right": 0});
        } else {
            $("#header .header-bottom").removeClass("sticky-menu");
        }
    };
    sticky_navigation();
    $(window).scroll(function () {
        sticky_navigation();
    });

    $(document).ready(function () {
        $(".show-dropdown").each(function () {
            $(this).on("click", function () {
                $(this).toggleClass("show");
                var $element = $(this).parent().find("> ul");
                $element.toggle(300);
            });
        });
    });

    function deleteItem(elem, id) {
        $.ajax({
            url: '/wish/delete?pid=' + id,
            type: 'get',
            success: function (data) {
                $(elem).parent().parent().remove()
            },
            fail: function (data) {
                console.log('fail')
            }
        })
    }

    function addToCart(elem, id) {
        $.ajax({
            url: '/wishCart/add?count=1&pid=' + id,
            type: 'post',
            success: function (data) {
                $(elem).parent().parent().remove()
                console.log("添加商品")

            },
            fail: function (data) {
                alert("fail")
            }
        })
    }
</script>

</body>
</html>